/**
 *   类说明
 * 
 *   @creator         xldc	497937995@qq.com  
 *   @create-time     2014年1月15日   下午6:36:09   
 */
package com.huacheng.cms.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.huacheng.cms.dao.ConfigMapper;
import com.huacheng.cms.model.Config;

@Service
public class ConfigService {
	@Autowired
	private ConfigMapper configM;

	public void addOne(Config config) {
		configM.insertSelective(config);
	}

	public Config getOneByKey(String key) {
		return configM.selectByPrimaryKey(key);
	}

	public int deleteOneByKey(String key) {
		return configM.deleteByPrimaryKey(key);
	}

	public int updateOneByObj(Config config) {
		return configM.updateByPrimaryKeySelective(config);
	}

	public int getListCountByObj(Config config) {
		return configM.selectBySelectiveCount(config);
	}

	public List<Config> getListByObj(Config config, long offset, long rows) {
		return configM.selectBySelective(config, offset, rows);
	}
}
